#include "utils.h"

namespace net {

void makeXmlHeader(rapidxml::xml_document<> &xml) {
	rapidxml::xml_node<>* decl = xml.allocate_node(rapidxml::node_declaration);
	decl->append_attribute(xml.allocate_attribute("version", "1.0"));
	decl->append_attribute(xml.allocate_attribute("encoding", "utf-8"));
	xml.append_node(decl);
}

std::string vectorToString(std::vector<char> v){
	std::string r;
	r.assign(v.begin(), v.end());
	return r;
}

std::vector<char> stringToVector(std::string s){
	std::vector<char> r;
	r.assign(s.begin(), s.end());
	return r;
}
}
